package com.itheima.controller;

import com.itheima.domain.Items;
import com.itheima.service.IItemsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/items")
public class ItemsController {
    @Autowired
    private IItemsService itemsService;
    @RequestMapping("/findxiang")
    public String findxiang(Model model){
        Items items = itemsService.findById(1);
        model.addAttribute("item",items);
        return "list";

        //问题1 :拆分了 报错404,web.xml springmvc爆红
        //问题2:用tomcat插件启动不了 ,服务器能启动

    }

}
